<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>             //    key      value
        localStorage.setItem('uname','小明')
        localStorage.setItem('dog','小黄')
        console.log( localStorage.getItem('uname'))
        //localStorage.removeItem('uname')
        //清除localStorage.clear()

        //没有持久性
        sessionStorage.setItem('uname','小刚')
        sessionStorage.setItem('dog','小黄')
        console.log( sessionStorage.getItem('uname'))
    </script>
</body>
</html>